@charset "utf-8";

// 定义设计宽度和高度
$designWidth: 1920;
$designHeight: 1080;

// 将像素值转换为视口宽度百分比（vw）
@mixin px2vw($name, $px) {
  #{$name}: ($px / $designWidth) * 100vw;
}

// 将像素值转换为视口高度百分比（vh）
@mixin px2vh($name, $px) {
  #{$name}: ($px / $designHeight) * 100vh;
}

// 设置字体大小
@mixin px2font($px) {
  font-size: ($px / $designWidth) * 100vw;
}

// 设置边距
@mixin px2margin($top, $right, $bottom, $left) {
  margin: ($top / $designHeight) * 100vh ($right / $designWidth) * 100vw ($bottom / $designHeight) * 100vh ($left / $designWidth) * 100vw;
}

// 设置内边距
@mixin px2padding($top, $right, $bottom, $left) {
  padding: ($top / $designHeight) * 100vh ($right / $designWidth) * 100vw ($bottom / $designHeight) * 100vh ($left / $designWidth) * 100vw;
}
//设置边框
@mixin px2border($width,$style,$color){
    border: ($width / $designWidth) * 100vw $style $color;
}